package com.xwaf.platform.web.filter;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;

import com.xwaf.platform.common.api.enums.LockType;

@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface LockInterceptor {

	String lockName() default "default";

	LockType lockType() default LockType.REENTRANT_LOCK;

	/** 获取锁等待时间 **/
	long waitTime() default 3000L;

	/** 锁自动释放时间,默认30秒 **/
	long leaseTime() default 30000L;

	/** 时间单位 **/
	TimeUnit unit() default TimeUnit.MILLISECONDS;
}
